<?php
//
// +------------------------------------------------------------------------+
// | Gecko Framework                                                        |
// +------------------------------------------------------------------------+
//

/**
 * Checks if the current user is allowed to perform a action
 * the user must be in the registry under "user"
 *
 * @param string $action
 * @param string $controller
 * @return boolean
 */
function is_allowed($action, $controller = '') {
	if( Zend_Registry::isRegistered( "user" ) ) {
		$user = Zend_Registry::get( "user" );

		return $user->isAllowedTo($action, $controller);
	} else {
		return true;
	}
}